package JavaCore.designpattern.strategyPattern;

import java.util.HashMap;
import java.util.Map;

/**
 * @author LiXingShuai
 * @ClassName StrategyPatternTest
 * @description: 策略模式demo
 * @date 2023年02月26日
 * @version: 1.0
 */
public class StrategyPatternTest {

    private static Map<String,UserService> map = new HashMap<>(4);
    static {
        map.put("visitor",new VisitorUserServiceImpl());
        map.put("registered",new RegisteredUserServiceImpl());
        map.put("vip",new VIPUserServiceImpl());
    }

    public static void main(String[] args) {
        UserService userService = map.get("registered");
        System.out.println(userService.canDo());
    }







}
